#include "thread.h"
#include <iostream>

Thread::Thread() {
}

Thread::~Thread() {
}

int Thread::start() {
	int retval = pthread_create(&(this->mThread) , NULL , Thread::entry , this);
	return retval;
}

void Thread::join() {
	pthread_join(this->mThread , NULL);
}

void Thread::cancel() {
	pthread_cancel(this->mThread);
}

void* Thread::entry(void* pArg) {
	Thread* tThread = (Thread*) pArg;
	tThread->run();
}

int Thread::run() {
	setup();
	execute();
}

void Thread::setup() {
}

void Thread::execute() {
}
